home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 13 / 013.d81 / disk format (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  3KB  |  86 lines

  1. 10 poke646,1:poke53280,0:poke53281,0:print"[147]":s$="          ":goto40
  2. 20 getjunk$:ifjunk$<>""then20
  3. 30 return
  4. 40 print" this program will format a new disk so"
  5. 50 print"that files and programs may be stored"
  6. 60 print"upon it.  if this process is performed"
  7. 70 print"upon a disk which is already used for"
  8. 80 print"such storage, all information on that"
  9. 90 print"disk will be erased."
  10. 95 print"  1.  continue program"
  11. 96 print"  2.  exit to loadstar"
  12. 97 print"which ?";
  13. 98 poke198,0:wait198,1:geta$:ifa$<>"1"anda$<>"2"then98
  14. 99 ifa$="2"then63000
  15. 100 print:print"remove the present disk from the drive!"
  16. 110 gosub20
  17. 120 print"is the disk drive empty?  (y/n)"
  18. 130 geta$:ifa$=""goto130
  19. 140 print"[147]":ifa$<>"y"goto100
  20. 150 print"the new disk should have a name of less"
  21. 160 print"than 17 characters which cannot include"
  22. 170 print"commas and quotation marks."
  23. 180 print"type the name of the disk and then pressthe return[146] key";
  24. 181 b$=""
  25. 182 geta$:ifa$=""goto182
  26. 183 ifasc(a$)=20thenprint"[147]"s$"      restart"s$"       ":goto150
  27. 184 ifasc(a$)=34goto205
  28. 186 ifasc(a$)=44goto205
  29. 188 ifasc(a$)=13goto192
  30. 190 printa$;:b$=b$+a$:goto182
  31. 192 iflen(b$)<17goto210
  32. 200 print"[147]";b$:print" is too long for a disk name.":goto150
  33. 205 print"[147]  illegal character following ";b$;"":goto150
  34. 209 print"[147]           illegal  character           "
  35. 210 print:print"the new disc needs an identification"
  36. 220 print"number of two characters which cannot"
  37. 230 print"include commas and quotation marks."
  38. 240 c$="":print"type the identification number"
  39. 242 geta$:ifa$=""goto242
  40. 244 ifasc(a$)=34goto209
  41. 246 ifasc(a$)=44goto209
  42. 248 c$=a$:printc$;
  43. 250 geta$:ifa$=""goto250
  44. 252 ifasc(a$)=34goto209
  45. 254 ifasc(a$)=44goto209
  46. 256 printa$
  47. 260 c$=c$+a$
  48. 270 d$="n0:"+b$+","+c$
  49. 300 print"[147]    place the new disk in the drive     [146]"
  50. 310 print"all information presently on the disk"
  51. 320 print"which is now in the drive will be"
  52. 330 print"erased if you press y[146]."
  53. 340 gosub20
  54. 350 print"is the new disk in the drive?  (y/n)"
  55. 360 geta$:ifa$=""goto360
  56. 370 ifa$<>"y"goto300
  57. 380 print"[147] wait 80 seconds....formatting the disk "
  58. 390 open15,8,15,d$
  59. 395 input#15,er,er$,tr,se
  60. 396 ifer<>0thengosub1000:close15:goto430
  61. 400 close15
  62. 410 print"[147]this disk is ready for storage."
  63. 420 gosub20
  64. 430 print"                  menu                  "
  65. 440 print"1[146]  format another disk with same name      and id number"
  66. 450 print"2[146]  format another disk with same name"
  67. 455 print"but different id number"
  68. 460 print"3[146]  format another disk with different"
  69. 465 print"name and id number"
  70. 470 print"4[146]  quit the program"
  71. 480 geta$:ifa$=""goto480
  72. 490 print"[147]":onval(a$)goto300,210,100
  73. 500 print"[147]put the loadstar disk back in the drive."
  74. 502 print"          and press a key."
  75. 504 poke198,0:wait198,1:geta$
  76. 505 goto63000
  77. 506 :
  78. 1000 print"[147]we have encountered an error!"
  79. 1010 print"the error has a code of:"er
  80. 1020 print"the error message is   :"er$
  81. 1030 print"please try again or use another disk."
  82. 1040 print""spc(13)"<press a key>"
  83. 1050 poke198,0:wait198,1:getm$:print"[147]";:return
  84. 63000 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
  85. 63010 poke631,13:poke632,13:poke198,2:end
  86.